import { DesignFormFieldSelect } from "@/api/design/designForm";
import { DesignListMenuInfo } from "@/api/design/designList";
import { FormControlType } from "../DesignForm";

export interface ListSetting {
  id?: string;
  name?: string;
  formId?: string;
  formName?: string;
  fieldGroup?: string[];
  fieldCheckBox?: DesignFormFieldSelect[];
  fieldCheckAll?: boolean;
  tableConfig?: DesignListTableConfig[];
  listConfig?: DesignListConfig;
  menuConfig?: DesignListMenuInfo;
}

export interface DesignListTableConfig {
  fieldName?: string;
  fieldText?: string;
  renderType?: "string" | "tag";
  fieldType?: FormControlType;
  isSort?: boolean;
  isSearch?: boolean;
  options?: DesignListColumnOption[];
}

export interface DesignListColumnOption {
  label?: string;
  value?: string;
  type?: "primary" | "success" | "warning" | "danger" | "info";
  color?: string;
}

export interface DesignListConfig {
  defaultOrder?: "ascending" | "descending";
  defaultOrderBy?: string;
}
